home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / rcs56.zoo / rcs / man / ci.txt < prev    next >
Encoding:
Text File  |  1992-01-26  |  18.6 KB  |  595 lines

  1.  
  2.  
  3.  
  4. CI(1)            Printed December 19, 1991            CI(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      ci    - check    in RCS revisions
  10.  
  11. SYNOPSIS
  12.      ci    [options] file ...
  13.  
  14. DESCRIPTION
  15.      ci    stores new revisions into RCS files.  Each pathname
  16.      matching an RCS suffix is taken to    be an RCS file.     All
  17.      others are    assumed    to be working files containing new
  18.      revisions.     ci deposits the contents of each working file
  19.      into the corresponding RCS    file.  If only a working file is
  20.      given, ci tries to    find the corresponding RCS file    in an RCS
  21.      subdirectory and then in the working file's directory.  For
  22.      more details, see FILE NAMING below.
  23.  
  24.      For ci to work, the caller's login    must be    on the access
  25.      list, except if the access    list is    empty or the caller is
  26.      the superuser or the owner    of the file.  To append    a new
  27.      revision to an existing branch, the tip revision on that
  28.      branch must be locked by the caller.  Otherwise, only a new
  29.      branch can    be created.  This restriction is not enforced for
  30.      the owner of the file if non-strict locking is used (see
  31.      rcs(1)).  A lock held by someone else may be broken with the
  32.      rcs command.
  33.  
  34.      Unless the    -f option is given, ci checks whether the
  35.      revision to be deposited differs from the preceding one.  If
  36.      not, instead of creating a    new revision ci    reverts    to the
  37.      preceding one.  To    revert,    ordinary ci removes the    working
  38.      file and any lock;    ci -l keeps and    ci -u removes any lock,
  39.      and then they both    generate a new working file much as if
  40.      co    -l or co -u had    been applied to    the preceding revision.
  41.      When reverting, any -n and    -s options apply to the    preceding
  42.      revision.
  43.  
  44.      For each revision deposited, ci prompts for a log message.
  45.      The log message should summarize the change and must be
  46.      terminated    by end-of-file or by a line containing . by
  47.      itself.  If several files are checked in ci asks whether to
  48.      reuse the previous    log message.  If the standard input is
  49.      not a terminal, ci    suppresses the prompt and uses the same
  50.      log message for all files.     See also -m.
  51.  
  52.      If    the RCS    file does not exist, ci    creates    it and deposits
  53.      the contents of the working file as the initial revision
  54.      (default number:  1.1).  The access list is initialized to
  55.      empty.  Instead of    the log    message, ci requests descriptive
  56.      text (see -t below).
  57.  
  58.      The number    rev of the deposited revision can be given by any
  59.      of    the options -f,    -I, -k,    -l, -M,    -q, -r,    or -u.    rev may
  60.  
  61.  
  62.  
  63. Page 1                     TARGON /35     Operating System
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CI(1)            Printed December 19, 1991            CI(1)
  71.  
  72.  
  73.  
  74.      be    symbolic, numeric, or mixed.  If rev is    $, ci determines
  75.      the revision number from keyword values in    the working file.
  76.  
  77.      If    rev is a revision number, it must be higher than the
  78.      latest one    on the branch to which rev belongs, or must start
  79.      a new branch.
  80.  
  81.      If    rev is a branch    rather than a revision number, the new
  82.      revision is appended to that branch.  The level number is
  83.      obtained by incrementing the tip revision number of that
  84.      branch.  If rev indicates a non-existing branch, that branch
  85.      is    created    with the initial revision numbered rev.1.
  86.  
  87.      If    rev is omitted,    ci tries to derive the new revision
  88.      number from the caller's last lock.  If the caller    has
  89.      locked the    tip revision of    a branch, the new revision is
  90.      appended to that branch.  The new revision    number is
  91.      obtained by incrementing the tip revision number.    If the
  92.      caller locked a non-tip revision, a new branch is started at
  93.      that revision by incrementing the highest branch number at
  94.      that revision.  The default initial branch    and level numbers
  95.      are 1.
  96.  
  97.      If    rev is omitted and the caller has no lock, but owns the
  98.      file and locking is not set to strict, then the revision is
  99.      appended to the default branch (normally the trunk; see the
  100.      -b    option of rcs(1)).
  101.  
  102.      Exception:    On the trunk, revisions    can be appended    to the
  103.      end, but not inserted.
  104.  
  105. OPTIONS
  106.      -r[rev]
  107.       checks in a revision,    releases the corresponding lock,
  108.       and removes the working file.     This is the default.
  109.  
  110.       The -r option    has an unusual meaning in ci.  In other
  111.       RCS commands,    -r merely specifies a revision number,
  112.       but in ci it also releases a lock and    removes    the
  113.       working file.     See -u    for a tricky example.
  114.  
  115.      -l[rev]
  116.       works    like -r, except    it performs an additional co -l
  117.       for the deposited revision.  Thus, the deposited
  118.       revision is immediately checked out again and    locked.
  119.       This is useful for saving a revision although    one wants
  120.       to continue editing it after the checkin.
  121.  
  122.      -u[rev]
  123.       works    like -l, except    that the deposited revision is
  124.       not locked.  This lets one read the working file
  125.       immediately after checkin.
  126.  
  127.  
  128.  
  129. Page 2                     TARGON /35     Operating System
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CI(1)            Printed December 19, 1991            CI(1)
  137.  
  138.  
  139.  
  140.       The -l, -r, and -u options are mutually exclusive and
  141.       silently override each other.     For example, ci -u -r is
  142.       equivalent to    ci -r because -r overrides -u.
  143.  
  144.      -f[rev]
  145.       forces a deposit; the    new revision is    deposited even it
  146.       is not different from    the preceding one.
  147.  
  148.      -k[rev]
  149.       searches the working file for    keyword    values to
  150.       determine its    revision number, creation date,    state,
  151.       and author (see co(1)), and assigns these values to the
  152.       deposited revision, rather than computing them locally.
  153.       It also generates a default login message noting the
  154.       login    of the caller and the actual checkin date.  This
  155.       option is useful for software    distribution.  A revision
  156.       that is sent to several sites    should be checked in with
  157.       the -k option    at these sites to preserve the original
  158.       number, date,    author,    and state.  The    extracted keyword
  159.       values and the default log message may be overridden
  160.       with the options -d, -m, -s, -w, and any option that
  161.       carries a revision number.
  162.  
  163.      -q[rev]
  164.       quiet    mode; diagnostic output    is not printed.     A
  165.       revision that    is not different from the preceding one
  166.       is not deposited, unless -f is given.
  167.  
  168.      -I[rev]
  169.       interactive mode; the    user is    prompted and questioned
  170.       even if the standard input is    not a terminal.
  171.  
  172.      -d[date]
  173.       uses date for    the checkin date and time.  The    date is
  174.       specified in free format as explained    in co(1).  This
  175.       is useful for    lying about the    checkin    date, and for -k
  176.       if no    date is    available.  If date is empty, the working
  177.       file's time of last modification is used.
  178.  
  179.      -M[rev]
  180.       Set the modification time on any new working file to be
  181.       the date of the retrieved revision.  For example,
  182.       ci -d    -M -u f    does not alter f's modification    time,
  183.       even if f's contents change due to keyword
  184.       substitution.     Use this option with care; it can
  185.       confuse make(1).
  186.  
  187.      -mmsg
  188.       uses the string msg as the log message for all
  189.       revisions checked in.
  190.  
  191.      -nname
  192.  
  193.  
  194.  
  195. Page 3                     TARGON /35     Operating System
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CI(1)            Printed December 19, 1991            CI(1)
  203.  
  204.  
  205.  
  206.       assigns the symbolic name name to the    number of the
  207.       checked-in revision.    ci prints an error message if
  208.       name is already assigned to another number.
  209.  
  210.      -Nname
  211.       same as -n, except that it overrides a previous
  212.       assignment of    name.
  213.  
  214.      -sstate
  215.       sets the state of the    checked-in revision to the
  216.       identifier state.  The default state is Exp.
  217.  
  218.      -tfile
  219.       writes descriptive text from the contents of the named
  220.       file into the    RCS file, deleting the existing    text.
  221.       The file may not begin with -.
  222.  
  223.      -t-string
  224.       Write    descriptive text from the string into the RCS
  225.       file,    deleting the existing text.
  226.  
  227.       The -t option, in both its forms, has    effect only
  228.       during an initial checkin; it    is silently ignored
  229.       otherwise.
  230.  
  231.       During the initial checkin, if -t is not given, ci
  232.       obtains the text from    standard input,    terminated by
  233.       end-of-file or by a line containing .    by itself.  The
  234.       user is prompted for the text    if interaction is
  235.       possible; see    -I.
  236.  
  237.       For backward compatibility with older    versions of RCS,
  238.       a bare -t option is ignored.
  239.  
  240.      -wlogin
  241.       uses login for the author field of the deposited
  242.       revision.  Useful for    lying about the    author,    and for
  243.       -k if    no author is available.
  244.  
  245.      -Vn  Emulate RCS version n.  See co(1) for    details.
  246.  
  247.      -xsuffixes
  248.       specifies the    suffixes for RCS files.     A nonempty
  249.       suffix matches any pathname ending in    the suffix.  An
  250.       empty    suffix matches any pathname of the form    RCS/file
  251.       or path/RCS/file.  The -x option can specify a list of
  252.       suffixes separated by    /.  For    example, -x,v/ specifies
  253.       two suffixes:     ,v and    the empty suffix.  If two or more
  254.       suffixes are specified, they are tried in order when
  255.       looking for an RCS file; the first one that works is
  256.       used for that    file.  If no RCS file is found but an RCS
  257.       file can be created, the suffixes are    tried in order to
  258.  
  259.  
  260.  
  261. Page 4                     TARGON /35     Operating System
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CI(1)            Printed December 19, 1991            CI(1)
  269.  
  270.  
  271.  
  272.       determine the    new RCS    file's name.  The default for
  273.       suffixes is installation-dependent; normally it is ,v/
  274.       for hosts like Unix that permit commas in file names,
  275.       and is empty (i.e. just the empty suffix) for    other
  276.       hosts.
  277.  
  278. FILE NAMING
  279.      Pairs of RCS files    and working files may be specified in
  280.      three ways    (see also the example section).
  281.  
  282.      1)    Both the RCS file and the working file are given.  The
  283.      RCS pathname is of    the form path1/workfileX and the working
  284.      pathname is of the    form path2/workfile where path1/ and
  285.      path2/ are    (possibly different or empty) paths, workfile is
  286.      a filename, and X is an RCS suffix.  If X is empty, path1/
  287.      must be RCS/ or must end in /RCS/.
  288.  
  289.      2)    Only the RCS file is given.  Then the working file is
  290.      created in    the current directory and its name is derived
  291.      from the name of the RCS file by removing path1/ and the
  292.      suffix X.
  293.  
  294.      3)    Only the working file is given.     Then ci considers each
  295.      RCS suffix    X in turn, looking for an RCS file of the form
  296.      path2/RCS/workfileX or (if    the former is not found    and X is
  297.      nonempty) path2/workfileX.
  298.  
  299.      If    the RCS    file is    specified without a path in 1) and 2), ci
  300.      looks for the RCS file first in the directory ./RCS and then
  301.      in    the current directory.
  302.  
  303.      ci    reports    an error if an attempt to open an RCS file fails
  304.      for an unusual reason, even if the    RCS file's pathname is
  305.      just one of several possibilities.     For example, to suppress
  306.      use of RCS    commands in a directory    d, create a regular file
  307.      named d/RCS so that casual    attempts to use    RCS commands in    d
  308.      fail because d/RCS    is not a directory.
  309.  
  310. EXAMPLES
  311.      Suppose ,v    is an RCS suffix and the current directory
  312.      contains a    subdirectory RCS with an RCS file io.c,v.  Then
  313.      each of the following commands check in a copy of io.c into
  314.      RCS/io.c,v    as the latest revision,    removing io.c.
  315.  
  316.       ci  io.c;    ci  RCS/io.c,v;     ci  io.c,v;
  317.       ci  io.c  RCS/io.c,v;       ci  io.c  io.c,v;
  318.       ci  RCS/io.c,v  io.c;       ci  io.c,v  io.c;
  319.  
  320.      Suppose instead that the empty suffix is an RCS suffix and
  321.      the current directory contains a subdirectory RCS with an
  322.      RCS file io.c.  The each of the following commands    checks in
  323.      a new revision.
  324.  
  325.  
  326.  
  327. Page 5                     TARGON /35     Operating System
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CI(1)            Printed December 19, 1991            CI(1)
  335.  
  336.  
  337.  
  338.       ci  io.c;    ci  RCS/io.c;
  339.       ci  io.c  RCS/io.c;
  340.       ci  RCS/io.c    io.c;
  341.  
  342. FILE MODES
  343.      An    RCS file created by ci inherits    the read and execute
  344.      permissions from the working file.     If the    RCS file exists
  345.      already, ci preserves its read and    execute    permissions.  ci
  346.      always turns off all write    permissions of RCS files.
  347.  
  348. FILES
  349.      Several temporary files may be created in the directory
  350.      containing    the working file, and also in the temporary
  351.      directory (see TMPDIR under ENVIRONMENT).    A semaphore file
  352.      or    files are created in the directory containing the RCS
  353.      file.  With a nonempty suffix, the    semaphore names    begin
  354.      with the first character of the suffix; therefore,    do not
  355.      specify an    suffix whose first character could be that of a
  356.      working filename.    With an    empty suffix, the semaphore names
  357.      end with _    so working filenames should not    end in _.
  358.  
  359.      ci    never changes an RCS or    working    file.  Normally, ci
  360.      unlinks the file and creates a new    one; but instead of
  361.      breaking a    chain of one or    more symbolic links to an RCS
  362.      file, it unlinks the destination file instead.  Therefore,
  363.      ci    breaks any hard    or symbolic links to any working file it
  364.      changes; and hard links to    RCS files are ineffective, but
  365.      symbolic links to RCS files are preserved.
  366.  
  367.      The effective user    must be    able to    search and write the
  368.      directory containing the RCS file.     Normally, the real user
  369.      must be able to read the RCS and working files and    to search
  370.      and write the directory containing    the working file;
  371.      however, some older hosts cannot easily switch between real
  372.      and effective users, so on    these hosts the    effective user is
  373.      used for all accesses.  The effective user    is the same as
  374.      the real user unless your copies of ci and    co have    setuid
  375.      privileges.  As described in the next section, these
  376.      privileges    yield extra security if    the effective user owns
  377.      all RCS files and directories, and    if only    the effective
  378.      user can write RCS    directories.
  379.  
  380.      Users can control access to RCS files by setting the
  381.      permissions of the    directory containing the files;    only
  382.      users with    write access to    the directory can use RCS
  383.      commands to change    its RCS    files.    For example, in    hosts
  384.      that allow    a user to belong to several groups, one    can make
  385.      a group's RCS directories writable    to that    group only.  This
  386.      approach suffices for informal projects, but it means that
  387.      any group member can arbitrarily change the group's RCS
  388.      files, and    can even remove    them entirely.    Hence more formal
  389.      projects sometimes    distinguish between an RCS administrator,
  390.  
  391.  
  392.  
  393. Page 6                     TARGON /35     Operating System
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CI(1)            Printed December 19, 1991            CI(1)
  401.  
  402.  
  403.  
  404.      who can change the    RCS files at will, and other project
  405.      members, who can check in new revisions but cannot    otherwise
  406.      change the    RCS files.
  407.  
  408. SETUID USE
  409.      To    prevent    anybody    but their RCS administrator from deleting
  410.      revisions,    a set of users can employ setuid privileges as
  411.      follows.
  412.  
  413.      o Check that the host supports RCS    setuid use.  Consult a
  414.        trustworthy expert if there are any doubts.  It is best if
  415.        the seteuid() system call works as described in Posix
  416.        1003.1a Draft 5,    because    RCS can    switch back and    forth
  417.        easily between real and effective users,    even if    the real
  418.        user is root.  If not, the second best is if the    setuid()
  419.        system call supports saved setuid (the {_POSIX_SAVED_IDS}
  420.        behavior    of Posix 1003.1-1990); this fails only if the
  421.        real user is root.  If RCS detects any failure in setuid,
  422.        it quits    immediately.
  423.  
  424.      o Choose a    user A to serve    as RCS administrator for the set
  425.        of users.  Only A will be able to invoke    the rcs    command
  426.        on the users' RCS files.     A should not be root or any
  427.        other user with special powers.    Mutually suspicious sets
  428.        of users    should use different administrators.
  429.  
  430.      o Choose a    path name B that will be a directory of    files to
  431.        be executed by the users.
  432.  
  433.      o Have A set up B to contain copies of ci and co that are
  434.        setuid to A by copying the commands from    their standard
  435.        installation directory D    as follows:
  436.  
  437.       mkdir     B
  438.       cp  D/c[io]  B
  439.       chmod     go-w,u+s  B/c[io]
  440.  
  441.      o Have each user prepend B    to their path as follows:
  442.  
  443.       PATH=B:$PATH;     export     PATH  # ordinary shell
  444.       set  path=(B    $path)    # C shell
  445.  
  446.      o Have A create each RCS directory    R with write access only
  447.        to A as follows:
  448.  
  449.       mkdir     R
  450.       chmod     go-w  R
  451.  
  452.      o If you want to let only certain users read the RCS files,
  453.        put the users into a group G, and have A    further    protect
  454.        the RCS directory as follows:
  455.  
  456.  
  457.  
  458.  
  459. Page 7                     TARGON /35     Operating System
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. CI(1)            Printed December 19, 1991            CI(1)
  467.  
  468.  
  469.  
  470.       chgrp     G  R
  471.       chmod     g-w,o-rwx  R
  472.  
  473.      o Have A copy old RCS files (if any) into R, to ensure that
  474.        A owns them.
  475.  
  476.      o An RCS file's access list limits    who can    check in and lock
  477.        revisions.  The default access list is empty, which grants
  478.        checkin access to anyone    who can    read the RCS file.  If
  479.        you want    limit checkin access, have A invoke rcs    -a on the
  480.        file; see rcs(1).  In particular, rcs -e    -aA limits access
  481.        to just A.
  482.  
  483.      o Have A initialize any new RCS files with    rcs -i before
  484.        initial checkin,    adding the -a option if    you want to limit
  485.        checkin access.
  486.  
  487.      o Give setuid privileges only to ci, co, and rcsclean; do
  488.        not give    them to    rcs or to any other command.
  489.  
  490.      o Do not use other    setuid commands    to invoke RCS commands;
  491.        setuid is trickier than you think!
  492.  
  493. ENVIRONMENT
  494.      RCSINIT
  495.       options prepended to the argument list, separated by
  496.       spaces.  A backslash escapes spaces within an    option.
  497.       The RCSINIT options are prepended to the argument lists
  498.       of most RCS commands.     Useful    RCSINIT    options    include
  499.       -q, -V, and -x.
  500.  
  501.      TMPDIR
  502.       Name of the temporary    directory.  If not set,    the
  503.       environment variables    TMP and    TEMP are inspected
  504.       instead and the first    value found is taken; if none of
  505.       them are set,    a host-dependent default is used,
  506.       typically /tmp.
  507.  
  508. DIAGNOSTICS
  509.      For each revision,    ci prints the RCS file,    the working file,
  510.      and the number of both the    deposited and the preceding
  511.      revision.    The exit status    is zero    if and only if all
  512.      operations    were successful.
  513.  
  514. IDENTIFICATION
  515.      Author: Walter F. Tichy.
  516.      Revision Number: 5.9; Release Date: 1991/10/07.
  517.      Copyright O 1982, 1988, 1989 by Walter F. Tichy.
  518.      Copyright O 1990, 1991 by Paul Eggert.
  519.  
  520. SEE ALSO
  521.      co(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1),
  522.  
  523.  
  524.  
  525. Page 8                     TARGON /35     Operating System
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. CI(1)            Printed December 19, 1991            CI(1)
  533.  
  534.  
  535.  
  536.      rcsintro(1), rcsmerge(1), rlog(1),    rcsfile(5)
  537.      Walter F. Tichy, RCS--A System for    Version    Control,
  538.      Software--Practice    & Experience 15, 7 (July 1985),    637-654.
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591. Page 9                     TARGON /35     Operating System
  592.  
  593.  
  594.  
  595. ə